import Icon from '@/components/Icon'
import styled from 'styled-components'
interface WrapProps {
	nestingLevel: number
	isVip: boolean
	isOnline: boolean
	isMeeting: boolean
	isNameBlue: boolean
}
export const StyledListItem = styled.div`
	display: flex;
	&:hover {
		background: #c1dbec;
		.mt-status {
			display: none;
		}
		.mt-action {
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
	.mt-status {
		flex: 0 0 50px;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		padding-right: 10px;
	}
	.mt-action {
		flex: 0 0 50px;
		display: none;
		padding-left: 10px;
	}
	.is-calling {
		color: #2f9d6b;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		margin-right: 10px;
	}
`
export const ItemLabelWrap = styled.div<WrapProps>`
	display: flex;
	flex: 1;
	align-items: center;
	height: 38px;
	box-sizing: border-box;
	padding-left: ${(props) => {
		if (props.isOnline && props.isMeeting) {
			return `${props.nestingLevel * 22 + 18}px`
		} else {
			return `${props.nestingLevel * 22 + (props.nestingLevel > 0 ? 10 : 0) + 18}px`
		}
	}};
	overflow: hidden;
	.icon-toggle {
		flex: 0 0 14px;
		margin-right: 7px;
	}
	.icon-single-poll {
		left: ${(props) => {
			return `${props.nestingLevel * 22 + (props.nestingLevel > 0 ? 10 : 0)}px`
		}};
	}
	.avatar {
		flex: 0 0 24px;
		display: flex;
		align-items: center;
		position: relative;
		margin-right: 8px;
		.icon-right {
			position: absolute;
			bottom: -1px;
			right: -4px;
		}
	}
	.vip {
		flex: 0 0 26px;
		height: 15px;
		background-color: #5eb9ef;
		color: #ffffff;
		line-height: 15px;
		text-align: center;
		margin-right: 8px;
	}
	.name {
		color: ${(props) =>
			props.isOnline ? (props.isNameBlue ? `#2C8DC5` : `#000`) : props.isVip ? `#4e4e4e` : `#959697`};
		overflow: hidden;
		&.active-polling {
			color: #2bb7ff;
			font-weight: bold;
		}
		pre {
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}
`
export const StyledMemberList = styled.div`
	flex: 1;
	display: flex;
	flex-direction: column;
	.top-size {
		margin: 6px 0 16px;
		span {
			margin-left: 10px;
		}
	}
	.search {
		margin-bottom: 5px;
	}
	.member-list {
		flex: 1;
		overflow-y: auto;
		.list-item {
			height: 34px;
			line-height: 34px;
			cursor: pointer;
			user-select: none;
			.name {
				margin-left: 10px;
			}
		}
	}
	.tip {
		height: 21px;
		margin: 8px 0;
		display: flex;
		align-items: center;
		.icon-tips {
			margin-right: 10px;
		}
		.tip_text {
			color: #ccc;
		}
	}
`
export const IconRight = styled(Icon)`
	width: 14px;
	height: 14px;
	background-position: 0px -3346px;
`
export const IconSinglePoll = styled(Icon)`
	width: 18px;
	height: 18px;
	background-position: -342px -3304px;
	position: absolute;
	left: 0;
`
export const IconChairman = styled(Icon)`
	width: 19px;
	height: 19px;
	background-position: -674px -871px;
	margin-right: 3px;
	flex-shrink: 0;
`
export const IconSpeaker = styled(Icon)`
	width: 19px;
	height: 19px;
	background-position: -716px -871px;
	margin-right: 3px;
	flex-shrink: 0;
`
/**
 * 呼叫
 */
export const IconActionOffline = styled(Icon)`
	width: 24px;
	height: 24px;
	background-position: -394px -2541px;
	&:hover {
		width: 24px;
		height: 24px;
		background-position: -422px -2541px;
	}
`
export const IconMute = styled(Icon)<{ isOn: boolean }>`
	width: 24px;
	height: 24px;
	background-position: ${(props) => (props.isOn ? '-282px -2541px' : '-338px -2541px')};
	&:hover {
		width: 24px;
		height: 24px;
		background-position: ${(props) => (props.isOn ? '-310px -2541px' : '-366px -2541px')};
	}
`
